<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld" %>
<%@taglib prefix="mu" uri="/WEB-INF/tld/mallutil.tld"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<script type="text/javascript" charset="UTF-8" src="/js/pageable.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/yaodian100_front_soaddr.js"></script>
<link rel="stylesheet" href="/css/pdpagese_v2.css" type="text/css" media="screen" />
<c-rt:set var="parasSo" value="${null }"/>
<c-rt:set var="parasOp" value="${null }"/>
<c-rt:set var="parasSop" value="${null }"/>
<c-rt:set var="parasDetailQuotafilled" value="${null }"/>
<c-rt:set var="odpqParas" value="${null}"/>
<c-rt:if test="${!empty param.orderProdId}">
 
	${pu:reqSet('sopHql', 'from ServiceOrderProduct where orderProdId=?')}
	${pu:listAdd('paramsSop', pu:parseLong(param.orderProdId))}
	${pu:reqSet('serviceOrderProduct', pu:queryByHql(sopHql, pu:arrayGet('paramsSop'), null))}
	
	${pu:reqSet('orderProductsHql', 'from OrderProduct where orderProdId=?')}
	${pu:listAdd('paramsOp', pu:parseLong(param.orderProdId))}
	${pu:reqSet('orderProducts', pu:queryByHql(orderProductsHql, pu:arrayGet('paramsOp'), null))}
	${pu:reqSet('soHql', 'from ServiceOrders where orderId=?') }
	${pu:listAdd('paramsSo', orderProducts[0].orderId) }
	${pu:reqSet('sos', pu:queryByHql(soHql, pu:arrayGet('paramsSo'), null)) }
	${pu:reqSet('order', pu:get('com.yaodian100.ec.order.entity.Orders', orderProducts[0].orderId))}
</c-rt:if>
<style>
.promo-popup{padding:10px;*padding:10px 0 10px 8px; color:#666;line-height:1.4em; }
.promo-popup h2,.promo-popup h3{font-size:15px;color:#d12e6f; margin-bottom:.8em;}
.promo-popup h3{color:#666;}
.promo-popup p{margin:.5em 0;}
.promo-popup .d-line{background:url(/images/link_dote.gif) repeat-x scroll 0 50%; padding:1px 0;}
.promo-popup ol,.promo-popup ul{margin-bottom:1em;margin-left:2em;}
.promo-popup li{list-style:decimal;}
</style>
<script>
$(function(){
	$('#current_location').html(' > 退货申请');
	$("#province").children().each(function(index){
		if (trim($(this).text()) == trim('${order.receiverProvince}')){
			$("#province")[0].selectedIndex = index ;
			queryProvince2('${order.receiverCity}','${order.receiverArea}');
		}
	});		
});
</script>
<div class="content mb-od-dtl"> 

<c-rt:if test="${order.orderSt=='35' && order.memberId==mu:memberId()}">
<c-rt:if test="${orderProducts[0].prodTp!='5'}">


${pu:reqSet('quotafilledhql','from OrderProduct where orderId=? and prodTp=?')}
${pu:listAdd('paramsProductQuotafilled', order.orderId)}
${pu:listAdd('paramsProductQuotafilled', '5')}
${pu:reqSet('orderProductQuotafilled', pu:queryByHql(quotafilledhql, pu:arrayGet('paramsProductQuotafilled'), null))}
${pu:reqSet('opdqCount', pu:countByHql(quotafilledhql, pu:arrayGet('paramsProductQuotafilled'))) }

<c-rt:if test="${!empty orderProductQuotafilled}">
${pu:reqSet('returnCash', pu:toFloat(0)) }
${pu:reqSet('returnBonus', pu:toFloat(0)) }
${pu:reqSet('returnBenefit', pu:toFloat(0)) }
${pu:reqSet('returnMyWallet', pu:toFloat(0)) }
<%--计算满额购金额 --%>

	${pu:reqSet('quotaFilledProductPrice', pu:toFloat(orderProductQuotafilled[0].unitPrice)) }

<c-rt:forEach items="${sos}" var="so">
	<%--计算退货退款总金额 --%>
	<c-rt:if test="${so.srcType=='1' && so.orderSt!='70' && so.orderSt!='80'}">
		${pu:reqSet('returnCash', returnCash+so.returnCash) }
		${pu:reqSet('returnBonus', returnBonus+so.returnBonus) }
		${pu:reqSet('returnBenefit', returnBenefit+so.returnBenefit) }
		${pu:reqSet('returnMyWallet', returnMyWallet+so.returnMyWallet) }
	</c-rt:if>
	${pu:reqSet('sopsList', null) }
	${pu:listAdd('sopsList', so.serviceId) }
	${pu:reqSet('sops', pu:queryByHql('from ServiceOrderProduct where serviceId=?', pu:arrayGet('sopsList'), null)) }

</c-rt:forEach>
${pu:reqSet('serviceReturnTotalPrice', returnCach+returnBonus+returnBenefit+returnMyWallet) }
${pu:reqSet('totalReturnTotalPrice', order.returnTotalPrice+serviceReturnTotalPrice) }
</c-rt:if>
</c-rt:if>
<script>
var qpIsServicing='${qpIsServicing}';
var totalAmount=${order.amount};
var quotaFilledAmount=${order.campProductLimit};
var totalReturnTotalPrice=${totalReturnTotalPrice!=null?totalReturnTotalPrice:0};
var quotaFilledPrice=${quotaFilledProductPrice!=null?quotaFilledProductPrice:0};
var hasQuotaFilledProduct='false';
<c-rt:if test="${!empty orderProductQuotafilled}">
hasQuotaFilledProduct='true';
</c-rt:if>
function checkSubmit(){
	$('.msg').hide();
	
	hasError=false;
	if($('#receiverName').attr('value')==''){
		$('#receiverNameMsg').show();
		hasError=true;
	}
	if($('#province').attr('value')==''
		|| $('#city').attr('value')==''
		|| $('#district').attr('value')==''
		|| $('#receiverAddr').attr('value')==''
		|| $('#receiverZip').attr('value')==''){
		$('#addressMsg').show();
		hasError=true;
	}
	if($('#receiverPhoneArea').attr('value')==' ')$('#receiverPhoneArea').attr('value', '');
	if($('#receiverPhone').attr('value')==' ')$('#receiverPhone').attr('value', '');
	if($('#receiverExt').attr('value')==' ')$('#receiverExt').attr('value', '');
	
	if($('#receiverMobile').attr('value')==''){
		if($('#receiverPhoneArea').attr('value')==''
			|| $('#receiverPhone').attr('value')==''
			){
			
			$('#receiverPhoneMsg1').show();
			hasError=true;
		}else{
			if(
					$('#receiverPhone').attr('value').length<5
					|| $('#receiverPhone').attr('value').length>10
					|| isNaN($('#receiverPhone').attr('value'))
				){
				
				$('#receiverPhoneMsg2').show();
				hasError=true;
			}
		}
		
	}else if(isNaN($('#receiverMobile').attr('value')) || $('#receiverMobile').attr('value').length>11){
		$('#receiverMobileMsg').show();
		hasError=true;
	}
	if($('#mainQty0').attr('value')==''){
			$('#mainQty0Msg').show();
			hasError=true;
	}
	if($('#addonQty').attr('value')==''){
			$('#addonQtyMsg').show();
			hasError=true;
	}
	if($('#quotafilledQty').attr('value')==''){
		$('#quotafilledQtyMsg').show();
		hasError=true;
	}
	if($('#reason').val()==''){
		$('#reasonMsg').show();
		hasError=true;
	}
	if($('#description').attr('value')==''){
		$('#descriptionMsg').show();
		hasError=true;
	}else if($('#description').attr('value').length>250){
		$('#descriptionMaxMsg').show();
		hasError=true;
	}
	if($('#accessaryDescription').attr('value')==''){
		$('#accessaryDescriptionMsg').show();
		hasError=true;
	}else if($('#accessaryDescription').attr('value').length>100){
		$('#accessaryDescriptionMaxMsg').show();
		hasError=true;
	}
	
	if($('#attachInvoice').attr('checked')==''){
		$('#attachInvoiceMsg').show();
		hasError=true;
	}
	var hasSelectedQty=false;
	$('.qty').each(function(){
		if($(this).attr('value')>0){
			hasSelectedQty=true;
		}
		
	});
	if(!hasSelectedQty){
		$('#quotafilledQtyMsg').show();
		$('#addonQtyMsg').show();
		$('#mainQtyMsg').show();
		hasError=true;
	}
	if(!hasError){
		$('#submit_button').hide();
		document.returnProductForm.submit();
		return false;
	}else{
		location.href="#theTop";
	}
}
function checkQfPresent(needSubmit){
	$('#qfTR').hide();
	$('#quotaFilledProdSpecId').attr('disabled', 'disabled');
	$('#quotaFilledQty').attr('disabled', 'disabled');
	$('#quotaFilledId').attr('disabled', 'disabled');
	var mainUnitPrice=$('#mainUnitPrice').attr('value');
	var mainReturnPrice=0;
	$('.mainQty').each(function(){
		mainReturnPrice=$(this).attr('value')*mainUnitPrice;
	});
	var addOnReturnPrice=0;
	$('.addOnQty').each(function(i){
		if($(this).attr('value')!=''){
			
			addOnReturnPrice+=$(this).attr('value') * $('#addOn'+i+'UnitPrice').attr('value');
		}
	});
	
	var totalReturnPrice=mainReturnPrice+addOnReturnPrice;
	/*
	if(totalAmount-totalReturnPrice-quotaFilledPrice<quotaFilledAmount && qpIsServicing!='true' && hasQuotaFilledProduct=='true'){
		$('#qfTR').show();
		$('#quotaFilledProdSpecId').attr('disabled', '');
		$('#quotaFilledQty').attr('disabled', '');
		$('#quotaFilledId').attr('disabled', '');
		if(needSubmit)promptDialog('满额购','此笔订单办理退货后已不符满额购商品购买优惠，请连同满额购商品一起办理退货。', 'checkSubmit()');
		return true;
	}
	*/
	return false;
}
$(function(){
	$('.qty').each(function(){
		$(this).change(function(){
			checkQfPresent(false);
		});
	});
	$('#qfTR').hide();
	$('#submit_button').click(function(){
		if(checkQfPresent(true)){
			
		}else{
			checkSubmit();
		}
	});

		<c-rt:forEach items="${orderProducts}" var="op" varStatus="opStatus">
		$('#mainQty${opStatus.index}').change(function(){
			$('.mainQty${opStatus.index}').attr('value',$('#mainQty${opStatus.index}').attr('value'));
		}); 
		</c-rt:forEach>
		$('.msg').hide();
		$('.mainQty').each(function(){
			$(this).change(function(){
				var _this=$(this);
				if(_this.attr('value')==''){
					selectedMainQty=0;
					return;
				}
				selectedMainQty=_this.attr('value');
				//present
				$('.presentQty').each(function(){
					$(this).attr('value', selectedMainQty);
				});

				//addOn
				$('.mainQty > option').each(function(){
					mainQty=$(this).attr('value');
				}); 
				$('.addOnQty').each(function(){
					var addOnQty;
					$('option', this).each(function(){
						addOnQty=$(this).attr('value');
					});
					var addOnQtyE=selectedMainQty-(mainQty-addOnQty);
					if(addOnQtyE<0)addOnQtyE=0;
					$(this).attr('value', addOnQtyE);
				});
			});
		});

		$('.addOnQty').each(function(){
			$(this).change(function(){
				var addOnQty;
				$('option', this).each(function(){
					addOnQty=$(this).attr('value');
				});
				var selectedAddOnQty=$(this).attr('value');
				
				if(selectedMainQty==0){
					
				}else
				if((selectedAddOnQty<(selectedMainQty-(mainQty-addOnQty)))){
					$(this).attr('value', selectedMainQty-(mainQty-addOnQty));
				}
			});
		});
		$('.mainQty').each(function(){
			$(this).attr('value', '');
		});
		$('.addOnQty').each(function(){
			$(this).attr('value', '');
		});
});
var mainQty=0;
var selectedMainQty=0;
</script>
<div id="dialog"></div>
<form name="returnProductForm" method="post" action="<c-rt:url value="/member/serviceOrder/returnProduct.do"/>">
<input type="hidden" name="opdqCount" value="${opdqCount }"/>
<input type="hidden" name="token" value="${pu:getToken() }"/>
<input type="hidden" name="srcType" value="1"/>
<input type="hidden" name="orderId" value="${param.orderId }"/>
<input type="hidden" name="orderProdId" value="${param.orderProdId }"/>
<input type="hidden" name="prodTp" value="${orderProduct.prodTp }"/>
    <!-- 我的訂單 --> 
      <p align="center"><img src="/images/step_return.gif" alt="退货流程教学图"style="margin-bottom:7px;" /></p> 
      <p class="a-function"><a href="/help/8_policy.html" target="_blank">退货政策说明</a> | <a href="/help/8_return.html" target="_blank">退货流程说明</a></p> 
      <a name="theTop"></a>
      <h2>我要退货</h2> 
      <!-- 訂單資訊 --> 
      <h3>订单信息</h3> 
      <div class="d-show"> 
        <ul> 
          <li class="w-1of2"><strong>订单编号：</strong>${order.orderId }</li> 
          <li class="w-1of2"><strong>订购时间：</strong><fmt-rt:formatDate pattern="yyyy/MM/dd HH:mm" value="${order.createDate }"/></li> 
          <li class="w-1of2"><strong>收货人：</strong>${order.receiverName }</li> 
          <li class="w-1of2"><strong>支付方式：</strong>${pu:menuOption('Order.PaymentTp', order.paymentTp).name }<input type="hidden" name="paymentTp" value="${order.paymentTp }"/></li> 
        </ul> 
      </div> 
      <!-- 訂單資訊 --> 
      <!-- 退貨資訊 --> 
      <h3>退货信息<span>填写退货单信息缺失，可能造成我们无法为您办理退货事宜。</span></h3> 
      <div class="d-show"> 
        <ul> 
        	
        	
          <li class="w-1of1">
          
          <div><strong>退货数量：</strong></div>
          
          <div> 
	 		   <c-rt:forEach items="${order.orderProduct}" var="orderProduct" varStatus="opIndex">
	 		   <c-rt:if test="${param.orderProdId==orderProduct.orderProdId}">
	 		   
	 		   <c-rt:set var="paramsDetail" value="${null }"/>
	 		   <c-rt:set var="parasDetail" value="${null}"/>
	 		   <c-rt:set var="paramsDetail" value="${pu:addToList('parasDetail', orderProduct.orderProdId)}"/>
<c-rt:set var="orderProductDetails" value="${pu:queryByHql('from OrderProductDetail where orderProdId=? order by detailTp asc, prodSpecId asc', paramsDetail, null)}"/>
<c-rt:set var="isMain" value="false"/>
<c-rt:set var="isPrebuy" value="false"/>
<c-rt:set var="isPresent" value="false"/>
<c-rt:set var="isAddon" value="false"/>
<c-rt:set var="isCampaign" value="false"/>
<c-rt:set var="isQuotafilled" value="false"/>
<c-rt:set var="isCombo" value="false"/>
        		
			<c-rt:forEach items="${orderProductDetails}" var="productDetail" varStatus="index">
        		<c-rt:choose>
        			<c-rt:when test="${productDetail.detailTp=='0'}">
        				<c-rt:set var="isMain" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='1'}">
        				<c-rt:set var="isPrebuy" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='2'}">
        				<c-rt:set var="isPresent" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='3'}">
        				<c-rt:set var="isAddon" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='4'}">
        				<c-rt:set var="isCampaign" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='5'}">
        				<c-rt:set var="isQuotafilled" value="true"/>
        			</c-rt:when>
        			<c-rt:when test="${productDetail.detailTp=='6'}">
        				<c-rt:set var="isCombo" value="true"/>
        			</c-rt:when>
        		</c-rt:choose>
        	</c-rt:forEach> 
           
            	<!-- 類型3 --> 
            <table class="tb-2 LH-1"> 
	              <tr> 
	                <th width="300">商品名称</th> 
	                <th  width="110">属性</th> 
	                <th width="65">选择退货数量</th> 
	                <th>退货注意事项</th> 
                  </tr> 
	              <tr> 
	                <td valign="top" class="table-in" colspan="2">
	                	<table width="100%" cellspacing="0" cellpadding="0" border="0">
		                  <tbody><tr>
		                    <td width="300">
			                    <p>
		                    	<c-rt:if test="${orderProduct.prodTp=='0'}">
		                    	<span class="type-0">主商品</span>
		                    	</c-rt:if>
		                    	<c-rt:if test="${orderProduct.prodTp=='1'}">
		                    	<span class="type-1">预购</span>
		                    	</c-rt:if>
		                    	<c-rt:if test="${orderProduct.prodTp=='2'}">
		                    	<span class="type-2">赠品</span>
		                    	</c-rt:if>
		                    	<c-rt:if test="${orderProduct.prodTp=='3'}">
		                    	<span class="type-3">加价购</span>
		                    	</c-rt:if>
		                    	<c-rt:if test="${orderProduct.prodTp=='4'}">
		                    	<span class="type-4">活动</span>
		                    	</c-rt:if>
		                    	<c-rt:if test="${orderProduct.prodTp=='5'}">
		                    	<span class="type-5">滿额购</span>
		                    	</c-rt:if>
		                    	<c-rt:if test="${orderProduct.prodTp=='6'}">
		                    	<span class="type-6">N选M</span>
		                    	</c-rt:if>
		                    	${orderProduct.prodName }<input type="hidden" name="prodSpecId" value="${orderProduct.prodSpecId }"/>
		                    	</p>
		                    	<c-rt:forEach items="${orderProduct.applyCampaigns}" var="ac" varStatus="status2">
	          	
					          	<p>
					          	<c-rt:if test="${ac.active}">
					          		<span class="type-4">优惠</span>
					          	</c-rt:if>
					          	<c-rt:if test="${!ac.active}">
					          		<span class="type-6">优惠</span>（不符合）
					          	</c-rt:if>
					          	
				
								
					          	
					          	${pu:reqSet('pc', pu:get('com.yaodian100.ec.campaign.entity.Campaign', ac.campaignUuid)) }
					          	
					          	<a href="javascript:openCampaign_${opIndex.index }_${status2.index }()">${pc.campaignName } </a>
					          
								<script>
								<c-rt:set scope="request" var="campaignDetail">
				            	${pu:replaceAll(pc.campaignDetail, '\'', '&#39;')}
				            	</c-rt:set>
				            	<c-rt:set scope="request" var="campaignDesc">
				            	${pu:replaceAll(pc.campaignDesc, '\'', '&#39;')}
				            	</c-rt:set>
									function openCampaign_${opIndex.index }_${status2.index }(){
										var dialogId='dialog';
										<%
										String campaignDetail=(String)request.getAttribute("campaignDetail");
										String campaignDesc=(String)request.getAttribute("campaignDesc");
										campaignDetail=campaignDetail.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "");
										campaignDesc=campaignDesc.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "");
										request.setAttribute("campaignDetail", campaignDetail);
										request.setAttribute("campaignDesc", campaignDesc);
										%>
										title='活动信息';
										campaignTitle='${pu:replaceAll(pc.campaignName, '\'', '&#39;')}';
										desc= '${campaignDesc}';
										detail='${campaignDetail}';
										startDate= '<fmt-rt:formatDate value="${pc.startDateTime}" pattern="yyyy/MM/dd HH:mm:ss"/>';
										endDate= '<fmt-rt:formatDate value="${pc.endDateTime}" pattern="yyyy/MM/dd HH:mm:ss"/>';
										url= '${pc.campaignUrl}';
										width= 300;
										height= 'auto';
				
										var content=compositeCampaign(campaignTitle, desc, detail, startDate, endDate, url);
										openDialog(title, content,width,height);
										$( '#'+dialogId).dialog('option', 'position', 'top' );
									}
								</script>
				
				
					          	</p>
					          	</c-rt:forEach>
		                    </td>
		                    <td width="110"  valign="top">
		                    <c-rt:forEach items="${orderProductDetails}" var="productDetail" varStatus="index">
			                    <c-rt:if test="${productDetail.detailTp=='0'||productDetail.detailTp=='1'||productDetail.detailTp=='4'||productDetail.detailTp=='5'}">
		                    	${productDetail.prodSpecName }
		                    	</c-rt:if>
		                    	
		                    </c-rt:forEach>
		                    <c-rt:if test="${orderProduct.prodTp=='6'}">
		                    	-
		                    </c-rt:if>
	                    	</td>
	                      </tr>
	                      
	                      <c-rt:if test="${orderProduct.prodTp!='2'}">
	                        
	                            <c-rt:forEach items="${orderProductDetails}" var="productDetail" varStatus="index">
						        	<c-rt:if test="${prePD.prodSpecId!=productDetail.prodSpecId && (productDetail.detailTp=='2'||productDetail.detailTp=='6')}">
						        	
						        	
						        	<c-rt:set var="countHql">
									from OrderProductDetail where orderId=? and orderProdId=? and prodSpecId=? and detailTp=?
									</c-rt:set>
									<c-rt:set var="params" value="${null }"/>
									<c-rt:set var="paras" value="${null}"/>
									<c-rt:set var="params" value="${pu:addToList('paras', order.orderId)}"/>
									<c-rt:set var="params" value="${pu:addToList('paras', productDetail.orderProdId)}"/>
									<c-rt:set var="params" value="${pu:addToList('paras', productDetail.prodSpecId)}"/>
									<c-rt:set var="params" value="${pu:addToList('paras', '2')}"/>
									<c-rt:set var="productDetailCounts" value="${pu:countByHql(countHql,params)}"/>
									 <tr class="txt-gy">
						            <td width="300">
						            <p> <c-rt:if test="${productDetail.detailTp=='2'}"><span class="type-2">赠品</span></c-rt:if>• ${productDetail.prodName }
						            <input type="hidden" name="prodSpecId" value="${productDetail.prodSpecId }"/>
						            </p>
						            </td>
						            
						            <td width="110"  valign="top">${productDetail.prodSpecName}</td>
						            </tr>
						            <c-rt:set var="prePD" value="${productDetail}"/>
						        	</c-rt:if>
	                            </c-rt:forEach>
	                        
	                       </c-rt:if>
	                    </tbody>
	                   </table>
                    </td>
                    
                  <!--   <td td width="110" valign="top"> 
                    <c-rt:forEach items="${orderProductDetails}" var="productDetail" varStatus="index">
                    	
	                    <c-rt:if test="${productDetail.detailTp=='0'||productDetail.detailTp=='1'||productDetail.detailTp=='4'||productDetail.detailTp=='5'}">
	                    	${productDetail.prodSpecName }
	                    </c-rt:if>
	                    <c-rt:if test="${orderProduct.prodTp=='6'}">
	                    	-
	                    </c-rt:if>
	                    <ul>
	                    <c-rt:forEach items="${orderProduct.applyCampaigns}">
	                    <li>&nbsp;</li>
	                    </c-rt:forEach>
	                    </ul>
	                    <ul>
	                    <c-rt:if test="${productDetail.detailTp=='2'}">
	                    	<li>${productDetail.prodSpecName }</li>
	                    </c-rt:if>
	                    </ul>
	                    	                   
                    
                    
                    </c-rt:forEach>
                    </td>  -->
	                <td valign="top">

					 	<c-rt:if test="${!empty param.orderProdId}">
					    	<select name="qty" id="mainQty" class="mainQty qty"><option value="">请选择数量</option>
				          	<c-rt:forEach var="i" begin="1" end="${orderProduct.qty }" step="1"> 
				          	<option value="${i }">${i }</option>
				          	</c-rt:forEach>
				          	</select>
				          	<input type="hidden" name="mainUnitPrice" id="mainUnitPrice" value="${orderProduct.unitPrice }"/>
			         	</c-rt:if>
			         	<c-rt:if test="${!empty param.orderId}">
			          		${productDetailCounts }
						</c-rt:if>
						<c-rt:set var="prePD" value="${null}"/>
			          	<c-rt:forEach items="${orderProductDetails}" var="productDetail" varStatus="index">
				        	<c-rt:if test="${orderProduct.prodTp!='2' && productDetail.detailTp=='2'}">
				        	<input type="hidden" name="qty" class="presentQty" value=""/>
				            </c-rt:if>
			            </c-rt:forEach>
						<br /><span style="display:block"><span class="msg rn" id="mainQtyMsg">请选择退货数量</span></span>
					</td> 
	                <td valign="top">
		                <c-rt:if test="${!isQuotafilled}">
		                <p class="txt-rd">同一商品仅有一次退换货机会，请慎选您所要退货的数量。</p><p class="txt-gy">（例：同一商品购买5件，退2件后，剩餘3件将无法再申请退、换货。）</p> 
	                    </c-rt:if>
                    	<c-rt:if test="${isCombo }"><p class="txt-rd">活动商品办理退货，需将成套活动商品一同办理并寄回。</p></c-rt:if>
                    	<c-rt:if test="${isPresent}"><p class="txt-rd">办理退货时，请务必连同所有赠品一起寄回。</p></c-rt:if>
                    </td> 
                  </tr>
                   
                  <c-rt:if test="${isAddon}">
                  ${pu:reqSet('opdsIndex', 0) }
                  <c-rt:forEach items="${orderProductDetails}" var="productDetail" varStatus="index">
	        	  <c-rt:if test="${productDetail.detailTp=='3'}">
	              <tr> 
	                <td><p><span class="type-3">加购</span>
	        

			${productDetail.prodName }<input type="hidden" name="prodSpecId" value="${productDetail.prodSpecId }"/>
			<c-rt:set var="prePD" value="${productDetail}"/>
			
	                </p></td> 
	                 <td td width="110" valign="top"> 
                     <c-rt:if test="${productDetail.detailTp=='3'}">
	                    	${productDetail.prodSpecName }
	                    </c-rt:if>
                    </td> 
	                <td valign="top">
<c-rt:if test="${!empty param.orderProdId}">
<select name="qty" id="addOn${opdsIndex}Qty" class="addOnQty qty"><option value="">请选择数量</option>
          <c-rt:forEach var="i" begin="1" end="${productDetail.qty }" step="1"> 
          <option value="${i }">${i }</option>
          </c-rt:forEach>
          </select>
          <input type="hidden" name="addOnUnitPrice" id="addOn${opdsIndex }UnitPrice" value="${productDetail.unitPrice }"/>
</c-rt:if>

<br /><span style="display:block"><span class="msg rn" id="addonQtyMsg">请选择退货数量</span></span></td> 
	                
	                <td valign="top"><p class="txt-rd">若要退主商品，需连同加购商品一起办理退货。</p></td> 
	                
                  </tr>
                  ${pu:reqSet('opdsIndex', opdsIndex+1) }
                  </c-rt:if>
			</c-rt:forEach>
                  </c-rt:if> 
                  <c-rt:if test="${opdqCount >0}">
                  <tr id="qfTR"> 
	                <td><p><span class="type-5">满额购</span>
<c-rt:if test="${qpIsServicing!=true}">
<c-rt:forEach items="${orderProductQuotafilled}" var="productQ" varStatus="index">
        	
        	<%--
        	<c-rt:set var="countHql">
			from OrderProductDetail where orderId=? and orderProdId=? and prodSpecId=? and detailTp=?
			</c-rt:set>
			<c-rt:set var="params" value="${null }"/>
			<c-rt:set var="paras" value="${null}"/>
			<c-rt:set var="params" value="${pu:addToList('paras', order.orderId)}"/>
			<c-rt:set var="params" value="${pu:addToList('paras', productDetail.orderProdId)}"/>
			<c-rt:set var="params" value="${pu:addToList('paras', productDetail.prodSpecId)}"/>
			<c-rt:set var="params" value="${pu:addToList('paras', '5')}"/>
			<c-rt:set var="productDetailCounts" value="${pu:countByHql(countHql,params)}"/>
			--%>
			${productQ.prodName }<input type="hidden" name="prodSpecId" value="${productQ.prodSpecId }" id="quotaFilledProdSpecId" disabled="disabled"/>
			<input type="hidden" name="quotaFilledId" id="quotaFilledId" value="${productQ.prodSpecId }" disabled="disabled"/>
			</c-rt:forEach>
</c-rt:if>
</p></td> 
	                <td valign="top">
<c-rt:if test="${!empty param.orderProdId}">
1
<%--
<select name="qty" id="quotafilledQty" class="qty"><option value="">请选择数量</option>
<option value="0">0</option>
<option value="1">1</option>
</select>
--%>
<input type="hidden" name="qty" value="1" id="quotaFilledQty" disabled="disabled"/>
<%--
<select name="qty" id="quotafilledQty"><option value="">请选择数量</option>
          <c-rt:forEach var="i" begin="0" end="${productDetailCounts }" step="1"> 
          <option value="${i }">${i }</option>
          </c-rt:forEach>
          </select>
--%>
</c-rt:if>
<br /><span style="display:block"><span class="msg rn" id="quotafilledQtyMsg">请选择退货数量</span></span></td> 
	                <td valign="top"><p class="txt-rd">满额购商品已不符合满额购优惠标準，需连同退货商品一同办理退货。  </p></td> 
                  </tr> 
                  </c-rt:if>
              </table> 
	 		   <!-- 類型3 -->
	 		   </c-rt:if>
	 		   </c-rt:forEach>
            </div> 
          	<!-- 退货表格 --> 
          
          </li> 
          
          
          <li class="w-1of1"><strong>退货原因：</strong>
          <select name="reason" id="reason">
          <option value="">请选择原因</option>
          <option value="订购错误">订购错误</option>
          <option value="商品发错">商品发错</option>
          <option value="商品或外包装破损">商品或外包装破损</option>
          <option value="商品不如预期">商品不如预期</option>
          <option value="商品属性不符">商品属性不符</option>
          <option value="价格比较贵">价格比较贵</option>
          <option value="与介绍不符">与介绍不符</option>
          <option value="改买其他款式">改买其他款式</option>
          <option value="商品未如期收到">商品未如期收到</option>
          <option value="不会使用">不会使用</option>
          <option value="其他">其他</option>
          
          </select>
          <span style="display:block"><span class="msg rn" id="reasonMsg">请选择退货原因</span></span>
          </li> 
          <li class="w-1of1 return-txt"><div><strong><span class="txt-rd">*</span> 退货原因描述：</strong><br /><i>(必填!请详述)</i></div><div><textarea name="description" id="description"></textarea>
          <span style="display:block"><span class="msg rn" id="descriptionMsg">请填退货原因描述</span></span>
          <span
			style="display:block"><span class="msg rn" id="descriptionMaxMsg">最多可输入250个中文字</span></span>
          </div>
          
          </li> 
          <li class="w-1of1 return-txt"> 
          	<div><strong><span class="txt-rd">*</span> 配件赠品状态：</strong><br /><i>(必填!请详述)</i></div> 
            <div> 
            	<input class="return-txtfild" type="text" name="accessaryDescription" id="accessaryDescription" /><span style="display:block"><span class="msg rn" id="accessaryDescriptionMsg">请填配件及赠品状态</span></span>
            	 <span style="display:block"><span class="msg rn" id="accessaryDescriptionMaxMsg">最多可输入100个中文字</span></span>
            	<br /> 
                <span class="txt-rd">请註明配件及赠品状态是否完整，若有缺少或损坏，将不予受理退货或须部份赔偿。(若无配件请填"无")</span><br /> 
              <input type="checkbox" name="attachInvoice" id="attachInvoice" value="1" /> 是否已附上发货单<span style="display:block"><span class="msg rn" id="attachInvoiceMsg">请附上发货单</span></span></div> 
          </li> 
        </ul> 
      </div> 
      <!-- 退貨資訊 --> 
      <!-- 聯絡資訊 --> 
      <h3>联络信息<span>填写退货单信息缺失，可能造成我们无法为您办理退货事宜</span></h3> 
      <div class="d-show"> 
      	<ul> 
          <li class="w-1of1"> 
          	<div><strong style="padding-left:2.2em;">姓名：</strong></div> 
            <div><input type="text" name="receiverName" id="receiverName" value="${order.receiverName }" size="10" /><br /><span style="display:block"><span class="msg rn" id="receiverNameMsg">请输入联络人姓名</span></span></div> 
          </li> 
          <li class="w-1of1 my-listadd"> 
            <div><strong>联络地址：</strong></div> 
            <div>省份：<select id="province" name="receiverProvince" class="c-prov"><option value="">== 选择省 ==</option>
            	<c-rt:forEach items="${provincesMap}" var="province" >
								<option value="${province.key}">${province.key}</option>
							</c-rt:forEach>
            </select> 
              市：<select name="receiverCity" id="city"> 
                <option value="">== 选择城市 ==</option>
              </select> 
              区：<select name="receiverArea" id="district"> 
                <option value="">== 选择地区 ==</option>
              </select> 
              <br /> 
              邮编：<input type="text" name="receiverZip" id="receiverZip" value="${order.receiverZip}"/>
              街道：<input size="50" name="receiverAddr" id="receiverAddr" value="${order.receiverAddr }" /> 
              <span id=33 style="display:block"><span class="msg rn" id="addressMsg">请输入完整的联络地址</span></span> 
            </div> 
          </li> 
          <li class="w-1of1"><div><strong>手机電話：</strong></div><div><input type="text" name="receiverMobile" id="receiverMobile" value="${order.receiverMobile }" size="10" /><br /><span style="display:block"><span class="msg rn" id="receiverMobileMsg">手机号码长度最多十一位，限数字。</span></span></div></li> 
          <li class="w-1of1"><div><strong>固定電話：</strong></div><div><input type="text" name="receiverPhoneArea" id="receiverPhoneArea" value="${order.receiverPhoneArea }" size="3" />-<input type="text" name="receiverPhone" id="receiverPhone" value="${order.receiverPhone }" size="7" />-分机<input type="text" name="receiverExt" id="receiverExt" value="${order.receiverExt }" size="4" /><br /><span style="display:block"><span class="msg rn" id="receiverPhoneMsg1">请至少填写一组电话</span></span><span style="display:block"><span class="msg rn" id="receiverPhoneMsg2">电话号码长度最少五位，最多十位，限数字。</span></span></div></li> 
        </ul> 
      
      
      
        
      </div> 
        <!-- 聯絡資訊 --> 
        <!-- 退款方式 --> 

     <h3>退款方式说明</h3>

      <div class="d-show">
      <ul>
            <li><strong>如您符合退货标准，耀点100将为您办理退款：</strong></li>
      </ul>
       </div>
          <ul class="li-w1" style=" margin-left:2em">
            <li>．退款方式与时间将依据支付方式与而有不同，可查看<a href="/help/7_refunetime.html" target="_blank">退款方式与时间说明</a>做进一步了解。</li>

            <li>．如您所退货的商品有使用礼券支付，则退款时将一概不返还礼券。<a href="/help/3_coupons.html#rule" target="_blank">(礼券使用规则)</a></li>
            <li>．确认退货商品无误后，将于 3个工作天内完成退款；若您透过支付宝使用借记卡支付，将于 5个工作天内完成退款。</li>
          </ul>
      
      <!-- 退款方式 --> 
      <p align="center"><a href="#theTop" id="submit_button" class="btn-mid">确认提交</a> 
      <%--
      <a href="javascript:;" onclick="document.returnProductForm.reset()" class="btn-mid-gy">重填</a>
      --%>
      </p> 
          <!-- 注意事项 --> 
      <div class="txt-note"> 
        <p><strong>注意事項：</strong></p> 
        <ul> 
          <li>1.如欲退货，请于<span class="txt-rd">签收商品七天内</span>，线上申请退货。</li> 
          <li>2.对于退货方式有任何疑问，请先参考<a href="/help/8_return.html" target="_blank" class="a-blue">退货流程说明</a>，或<a class="a-blue" href="<c-rt:url value="/member/cs/page.do?page=request&orderId=${order.orderId }&productId=${orderProducts[0].prodId }"/>" target="_blank">联络客服。</a></li> 
        </ul> 
        </div> 
            <!-- 注意事项 --> 
            <input type="hidden" value="${order.receiverProvince}" id="receiverProvince"/>
						<input type="hidden" value="${order.receiverCity}" id="receiverCity"/>
						<input type="hidden" value="${order.receiverArea}" id="receiverArea"/>
						<input type="hidden" value="${order.orderId}" id="orderId"/>
            </form>
</c-rt:if>
<c-rt:if test="${order.orderSt!='35'}">
货品未到货前无法退换货！
</c-rt:if>
<c-rt:if test="${order.memberId!=mu:memberId()}">
您无权检视本订单！
</c-rt:if>
    </div> 
   <!-- 我的訂單 --> 

